# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Lukasz Pozarlik <lpozarlik@gmail.com>

_pyname=igraph
pkgname=python-$_pyname
pkgver=0.11.3
pkgrel=1
url='https://igraph.org/python/'
license=(GPL)
arch=(loong64 x86_64)
pkgdesc='Python bindings for the igraph library'
depends=(glibc
         igraph
         python
         python-numpy
         python-texttable)
makedepends=(python-build
             python-installer
             python-setuptools
             python-wheel)
source=(https://github.com/igraph/python-igraph/releases/download/$pkgver/$_pyname-$pkgver.tar.gz)
sha256sums=('e55df60f882a51b8e8c1c5e7e940c5f90685d75634ea6df63bebcc983397adfa')

build() {
  cd igraph-$pkgver
  IGRAPH_USE_PKG_CONFIG=1 \
  python -m build --wheel --no-isolation
}

check() {
  cd igraph-$pkgver
  PYTHONPATH="$PWD"/`ls -d build/lib.*` python -m unittest
}

package() {
  cd igraph-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl 
}
